package com.hqs.drawingboard;

import android.content.Context;
import android.graphics.Color;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.hqs.common.utils.ScreenUtils;

/**
 * Created by super on 2017/7/4.
 */

public class QRelativeLayout extends RelativeLayout{

    private OnClickListener onClickListener;

    public QRelativeLayout(Context context) {
        super(context);
    }

    public QRelativeLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setOnClickListener(OnClickListener onClickListener) {
        this.onClickListener = onClickListener;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        TouchUtil.onTouch(event, new TouchUtil.OnMultiClickListener() {
            @Override
            public void onClick(View view) {
                onClickListener.onClick(view);
            }

            @Override
            public void onDoubleClick(View view) {

            }

            @Override
            public void onTrebleClick(View view) {

            }

            @Override
            public void on2Click(View view) {

            }

            @Override
            public void on2DoubleClick(View view) {

            }

            @Override
            public void on2TrebleClick(View view) {

            }

            @Override
            public void on3Click(View view) {

            }

            @Override
            public void on3DoubleClick(View view) {

            }

            @Override
            public void on3TrebleClick(View view) {

            }

            @Override
            public void on4Click(View view) {

            }

            @Override
            public void on4DoubleClick(View view) {

            }

            @Override
            public void on4TrebleClick(View view) {

            }
        }, this);

        return true;
    }
}
